

<%@ page import="myfirstgrailsstory.Task"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'task.label', default: 'Task')}" />
<title><g:message code="default.create.label"
	args="[entityName]" /></title>
</head>
<body>
<div class="nav"><span class="menuButton"><a class="home"
	href="${createLink(uri: '/')}">Home</a></span> <span class="menuButton"><g:link
	class="list" action="list">
	<g:message code="default.list.label" args="[entityName]" />
</g:link></span></div>
<div class="body">
<h1><g:message code="default.create.label" args="[entityName]" /></h1>
<g:if test="${flash.message}">
	<div class="message">
	${flash.message}
	</div>
</g:if> <g:hasErrors bean="${taskInstance}">
	<div class="errors"><g:renderErrors bean="${taskInstance}"
		as="list" /></div>
</g:hasErrors> <g:form action="save" method="post">
	<div class="dialog">
	<table>
		<tbody>

			<tr class="prop">
				<td valign="top" class="name"><label for="description"><g:message
					code="task.description.label" default="Description" /></label></td>
				<td valign="top"
					class="value ${hasErrors(bean: taskInstance, field: 'description', 'errors')}">
				<g:textField name="description" value="${taskInstance?.description}" />
				</td>
			</tr>

			<tr class="prop">
				<td valign="top" class="name"><label for="hours"><g:message
					code="task.hours.label" default="Hours" /></label></td>
				<td valign="top"
					class="value ${hasErrors(bean: taskInstance, field: 'hours', 'errors')}">
				<g:textField name="hours"
					value="${fieldValue(bean: taskInstance, field: 'hours')}" /></td>
			</tr>

			<tr class="prop">
				<td valign="top" class="name"><label for="name"><g:message
					code="task.name.label" default="Name" /></label></td>
				<td valign="top"
					class="value ${hasErrors(bean: taskInstance, field: 'name', 'errors')}">
				<g:textField name="name" value="${taskInstance?.name}" /></td>
			</tr>

			<tr class="prop">
				<td valign="top" class="name"><label for="project"><g:message
					code="task.project.label" default="Project" /></label></td>
				<td valign="top"
					class="value ${hasErrors(bean: taskInstance, field: 'project', 'errors')}">
				<g:select name="project.id"
					from="${myfirstgrailsstory.Project.list()}" optionKey="id"
					value="${taskInstance?.project?.id}"
					optionValue="name" /> 
				
			</tr>

		</tbody>
	</table>
	</div>
	<div class="buttons"><span class="button"><g:submitButton
		name="create" class="save"
		value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
	</div>
</g:form></div>
</body>
</html>
